package adv5;

import java.io.*;

public class FileCopy {

	public static void main(String[] args) {
		String fileName = "D:/我的文档/My Pictures/suanming.jpg";
		try {
			InputStream in = new FileInputStream(fileName);
			OutputStream out = new FileOutputStream("E:/Temp/kuaishou.jpg");
			byte b[] = new byte[1024];
			int len = 0;
			while ((len = in.read(b)) > 0) {
				out.write(b, 0, len);
			}

//			while (in.read() != -1) {
//				in.read(b);
//				out.write(b, 0, b.length);e
//			}
			out.close();
			in.close();
			System.out.println("copy finish");
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}
	}

}
